package com.nsy.dao;

import com.nsy.pojo.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {
    /**
     * 查询用户信息
     * @param sysUser
     * @return
     */
    SysUser getUserByUsernameAndPwd(SysUser sysUser);
    //用户列表
    List<SysUser> getAllUsers(@Param("username") String username);
    //根据id查询所有用户
    SysUser getUserById(@Param("id") Integer id);
    //添加用户
    int addUser( SysUser sysUser);
    //删除用户
    int deleteUser(@Param("id") Integer id);
    //修改用户
    int editUser(SysUser sysUser);
    //批量删除
    int deleteAllUser(@Param("ids") List<String> ids);
    //根据用户名查询
    SysUser getUserByUsername(String username);
    //修改密码
    //详情
    SysUser detailUser(Integer id);
    /**
     * 根据用户ID修改密码
     * @param oldPassword 旧密码
     * @param newPassword 新密码
     * @return 受影响的行数
     */
    int updatePasswordByPassword(@Param("oldPassword") String oldPassword, @Param("newPassword") String newPassword);
}
